package cn.edu.xaut.mybatisers.mall.ServiceImp;

import cn.edu.xaut.mybatisers.mall.Entity.Consumer;
import cn.edu.xaut.mybatisers.mall.Dao.ConsumerDao;
import cn.edu.xaut.mybatisers.mall.Service.ConsumerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpSession;
import java.sql.SQLException;

@Service
public class ConsumerServiceImp implements ConsumerService {
    @Autowired
    ConsumerDao consumerDao;

    @Override
    public Consumer getUserInfo(HttpSession session) throws SQLException {
        return consumerDao.getUserInfo((Integer) session.getAttribute("consumer_id"));
    }
}
